import { defineComponent, computed, unref, openBlock, createElementBlock, normalizeStyle, createBlock, resolveDynamicComponent, normalizeClass } from "vue";
const _hoisted_1 = ["src"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  props: {
    name: {
      type: String
    },
    size: {
      type: Number,
      default: () => 14
    },
    color: {
      type: String
    }
  },
  setup(__props) {
    const props = __props;
    const linesString = [
      "https",
      "http",
      "/src",
      "/assets",
      ""
    ];
    const getIconName = computed(() => {
      return props == null ? void 0 : props.name;
    });
    const isShowIconSvg = computed(() => {
      var _a;
      return (_a = props == null ? void 0 : props.name) == null ? void 0 : _a.startsWith("ele-");
    });
    const isShowIconImg = computed(() => {
      return linesString.find((str) => {
        var _a;
        return (_a = props.name) == null ? void 0 : _a.startsWith(str);
      });
    });
    const setIconSvgStyle = computed(() => {
      return `font-size: ${props.size}px;color: ${props.color};`;
    });
    const setIconImgStyle = computed(() => {
      return `width: ${props.size}px;height: ${props.size}px`;
    });
    return (_ctx, _cache) => {
      return unref(isShowIconSvg) ? (openBlock(), createElementBlock("i", {
        key: 0,
        class: "el-icon",
        style: normalizeStyle(unref(setIconSvgStyle))
      }, [
        (openBlock(), createBlock(resolveDynamicComponent(unref(getIconName))))
      ], 4)) : unref(isShowIconImg) ? (openBlock(), createElementBlock("img", {
        key: 1,
        src: unref(getIconName),
        style: normalizeStyle(unref(setIconImgStyle))
      }, null, 12, _hoisted_1)) : (openBlock(), createElementBlock("i", {
        key: 2,
        class: normalizeClass(unref(getIconName)),
        style: normalizeStyle(unref(setIconSvgStyle))
      }, null, 6));
    };
  }
});
var index = {
  install(app) {
    app.component("svg-icon", _sfc_main);
  }
};
export { index as default };
